/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import java.util.Arrays;

/**
 * This Class is necessary in order to use the hash MD5 byte array as a key on the java HashMap class
 * @author Gravena
 */
public class HashMD5 {
    private final byte[] data;
    
    public HashMD5(byte[] data)
    {
        if (data == null)
        {
            throw new NullPointerException();
        }
        this.data = data;
    }

    @Override
    public boolean equals(Object other)
    {
        if (!(other instanceof HashMD5))
        {
            return false;
        }
        return Arrays.equals(data, ((HashMD5)other).data);
    }

    @Override
    public int hashCode()
    {
        return Arrays.hashCode(data);
    }

    public byte[] getData() {
        return data;
    }
    
    
}
